<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<jsp:include page="../common/head.jsp" />
<title>编辑角色</title>
</head>
<body id="role-edit">
	<article class="page-container">
		<form action="role/save.do" method="post" class="form form-horizontal" id="role-form">
			<input type="hidden" value="${role.id}" name="id">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="${role.name}" placeholder="" id="name" name="name" required="true" maxlength="30">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"></label>
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius"  onclick="submitForm();" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</article>


</body>
<jsp:include page="../common/script.jsp" />
<script type="text/javascript">
	function submitForm(){
		U.msg('操作成功', 500, function() {
			/**1种：刷新父页面(体验不好)*/
			//window.parent.location.reload();
			
			/**2种： reload table部分*/
			//获取父级dom元素,触发事件
			$("#demoTable", window.parent.document).trigger("click");
			//关闭当前div
			var index = window.parent.layer.getFrameIndex(window.name);
			window.parent.layer.close(index);
		});
	}
</script>
</html>